package IOtest;
import java.io.*;

public class copy {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws IOException{
		File inputFile = new File("source.txt");
		File outputFile = new File("target.txt");

		//if(inputFile.exists())
		//{
			//BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(inputFile),"UTF-8"));
			//BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile),"UTF-8"));
			//BufferedReader in=new BufferedReader(new FileReader(inputFile));
			//BufferedWriter out=new BufferedWriter(new FileWriter(outputFile));
			FileReader in = new FileReader(inputFile);
			FileWriter out = new FileWriter(outputFile);
			int c;
			while((c=in.read())!=-1){
				out.write(c);
			}
		//out.flush();
		in.close();
		out.close();

		//}else {
		//	inputFile.createNewFile();
		
		//}
		
	}

}
